var app = sm("do_App");
var page = sm("do_Page");
var nf = sm("do_Notification");
var hashdata = mm("do_HashData");
var http = require("helper/http");
var circleUrl = require("url/circle");

page.on("back", function() {
	app.closePage();
});

var id = null;
page.on("loaded", function() {
	id = page.getData().id;
	showDetail();
});

var layoutHead = ui("layoutHead");
var addheader = layoutHead.add("header", "source://view/reuse/header.ui", 0, 0);
//左上角-返回
var headerLeft = ui(addheader+".headerLeft");
headerLeft.on("touch", function() {
  app.closePage()
});
ui(addheader+".labelTitle").text = "圈子升级详情";

function showDetail(){
	http.post(circleUrl.url.upgradeApply.detail,{id:id},function(data){
		var applyVo = data.applyVo;
		if(applyVo!=null && applyVo!=null){
			ui("imgLogo").source = applyVo.fullCircleLogo;
			ui("lableName").text = applyVo.circleName;
			ui("lableCommunityName").text = applyVo.communityName;
			ui("lableExtCom").text = applyVo.lastToExtCommunityNames;
			ui("lableToExtCom").text = applyVo.toExtCommunityNames;
			ui("lableToExtCity").text = applyVo.toCityName;	
			
			ui("lableApplyName").text = applyVo.applyName;//申请人
			ui("labelTime").text = applyVo.cnNewAt;
			var status = applyVo.status;
			var statusCn = "";
			if(status== "1"){
				statusCn =  "待审核";
			}else if(status== "2"){
				statusCn =  "升级成功";
			}else if(status== "3"){
				statusCn =  "审核不通过";
			}
			ui("lableStatus").text = statusCn;
		}
	});
	
}